import {getCategoryList,getFloor,getBannerList} from '@/ajax'
const state = {
  categoryList: [],
  bannerList: [],
  floor: []
}
const actions = {
 async getCateGoryList({commit}){
    const {data} = await getCategoryList()
    commit('getCategoryList',data)
  },
  async getBannerList({commit}) {
    const {data,code} = await getBannerList()
    if(code === 200) {
      commit('getBannerList',data)
    }
  },
  async getFloor({commit}) {
    const {data,code} = await getFloor()
    if(code === 200) {
      commit('getFloor',data)
    }
  },
}
const mutations = {
  getCategoryList(state,data) {
    state.categoryList = data
  },
  getBannerList(state,data) {
    state.bannerList = data
  },
  getFloor(state,data) {
    state.floor = data
  }
}
const getters = {
  
}
export default {
  state,
  actions,
  mutations,
  getters
}